home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / anacroz.swf / scripts / DefineSprite_1542 / frame_1 / DoAction.as
Text File  |  2010-11-09  |  2KB  |  48 lines

  1. stop();
  2. onPress = function()
  3. {
  4.    if(_currentframe > 1 && _currentframe < 4)
  5.    {
  6.       if(_currentframe == 2)
  7.       {
  8.          var _loc6_ = tropa1.soldados[_root.selecionado].getPV();
  9.          var _loc7_ = tropa1.soldados[_root.selecionado].getMaxPV();
  10.          var _loc3_ = _root.it_valores[0][2];
  11.          if(_loc6_ + _loc3_ > _loc7_)
  12.          {
  13.             tropa1.soldados[_root.selecionado].setPV(_loc7_);
  14.          }
  15.          else
  16.          {
  17.             tropa1.soldados[_root.selecionado].setPV(_loc6_ + _loc3_);
  18.          }
  19.          _root["sd" + _root.selecionado].msg_dano.valor = "<font size=\'15\' color=\'#006699\'><b>+" + _loc3_ + "</b></font>";
  20.          _root["sd" + _root.selecionado].msg_dano.gotoAndPlay(1);
  21.          _root.painel_status.edPV = tropa1.soldados[_root.selecionado].getPV();
  22.       }
  23.       else
  24.       {
  25.          var _loc4_ = tropa1.soldados[_root.selecionado].getPM();
  26.          var _loc5_ = tropa1.soldados[_root.selecionado].getMaxPM();
  27.          _loc3_ = _root.it_valores[1][2];
  28.          if(_loc4_ + _loc3_ > _loc5_)
  29.          {
  30.             tropa1.soldados[_root.selecionado].setPM(_loc5_);
  31.          }
  32.          else
  33.          {
  34.             tropa1.soldados[_root.selecionado].setPM(_loc4_ + _loc3_);
  35.          }
  36.          _root["sd" + _root.selecionado].msg_dano.valor = "<font size=\'15\' color=\'#006600\'><b>+" + _loc3_ + "</b></font>";
  37.          _root["sd" + _root.selecionado].msg_dano.gotoAndPlay(1);
  38.          _root.painel_status.edPM = tropa1.soldados[_root.selecionado].getPM();
  39.       }
  40.       _root.fx.attachSound("item_use");
  41.       _root.fx.start();
  42.       tropa1.soldados[_root.selecionado].itens.splice(_name.substr(4) - 1,1);
  43.       tropa1.soldados[_root.selecionado].itens.sortOn(["valor","tipo"],Array.RETURNINDEXEDARRAY);
  44.       this.gotoAndStop(1);
  45.       this.useHandCursor = false;
  46.    }
  47. };
  48.